<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

//上传图片
Route::resource('photo', 'PhotoController', ['only' => ['store']]);

Route::group(['prefix' => 'admin'], function () {
    Auth::routes();//登录注册

    Route::group(['namespace' => 'Admin', 'middleware' => ['auth','sitebar']],

        function () {

            //后台首页
            Route::get('/', 'HomeController@index')->name('home');

            require 'admin/shop.php';
            require 'admin/ads.php';
            require 'admin/wechat.php';
            require 'admin/system.php';
            require 'admin/crm.php';
        });
});


/***
 * 商城前端
 */
Route::group(['namespace' => 'Wechat','middleware' => ['wechat','wechat.oauth']], function () {
    //微信商城
    require 'wechat/shop.php';
});

//错误日志
Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');








